package test2;

import java.util.ArrayList;

/**
 * @Author Jun jie Yi
 * 2022/4/13 14:43
 */

public class Test6 {
    public static void main(String[] args) {
        ArrayList<String> aList = new ArrayList<String>();
        aList.add("bbc");
        aList.add("abc");
        aList.add("ysc");
        aList.add("saa");
        System.out.println("移除前：" + aList);
        for (int i = 0; i < aList.size(); i++) {
            String s = aList.get(i);
            if ("abc".equals(s)) {
                aList.remove(i);
            }
        }
        System.out.println("移除后：" + aList);
    }
}
